LearningStoreQuery.AddColumn Method

Add a new output column in the result.

Parent Type: LearningStoreQuery

Namespace: Microsoft.LearningComponents.Storage

Assembly: Microsoft.LearningComponents.Storage.dll

Syntax
C#

public void AddColumn (
string columnName

)

Parameters

columnName

Name of the column that should be returned in the result.

Exceptions
Exception type Condition
ArgumentNullException

columnName is a null reference.

InvalidOperationException

The column has already been added, or the column name wasn't found in the view.

Remarks

See the LearningStoreQuery documentation for more information about creating and executing queries.

Example

The following code creates a new query and adds two output columns:

C#
LearningStoreQuery query = store.CreateQuery("UserItem");
query.AddColumn("Id");
query.AddColumn("Name");
The result of the query will be a DataTable with two columns: "Id" (containing the Id of the user) and "Name" (containing the name of the user). One row will exist in the table for each user.